<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>
<script type="text/javascript">
	var fileNumLimit = 1;
</script>
<blockquote class="layui-elem-quote"><{$action}></blockquote>

<form class="layui-form layui-form-pane" method="post" action="<{$post_url}>" id="form_add_role">
	<input type="hidden" name="id" value="<{$info['id']|default:'0'}>" />
	<div class="layui-form-item">
		<label class="layui-form-label">习惯</label>
		<div class="layui-input-inline">
			<select name="habit_id" lay-verify="required">
				<option value="0" >请选择习惯</option>

				<{foreach from=$list item=item}>
					<{if $item['pid']==0}>
						<option value="<{$item['id']}>" >----<{$item['name']}></option>
					<{else}>
						<option value="<{$item['id']}>" >&nbsp;&nbsp;&nbsp;&nbsp;<{$item['name']}></option>
					<{/if}>
				<{/foreach}>
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">内容类型</label>
		<div class="layui-input-inline">
			<select name="content_type" lay-verify="required">
				<option value="1" >资讯</option>
				<option value="2" >图书</option>
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">内容ID</label>
		<div class="layui-input-block">
			<input type="text" name="content_id" value="<{$info.content_id|default:''}>" lay-verify="required" autocomplete="off" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">排序</label>
			<div class="layui-input-block">
				<input type="text" name="sort" value="<{$info.sort|default:'0'}>" autocomplete="off" class="layui-input">
			</div>
	</div>
	<div class="layui-form-item">
	    <label class="layui-form-label">是否启用</label>
	    <div class="layui-input-block">
	            <{assign var="status" value=$info.status|default:"1"}>
	            <input type="checkbox" <{if $status == 1}> checked <{/if}> name="status" lay-skin="switch" lay-filter="switchTest" value="1" >
	    </div>
  	</div>
	<div class="layui-input-block">
		<button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>


<{include file="public_html/footer.html"}>

<script>
		layui.use('layedit', function(){
		  var layedit = layui.layedit;
		  layedit.set({
			  uploadImage: {
			    url: '/upload/image'
			  }
			});
		  layedit.build('content'); //建立编辑器
		});
</script>
